import { RouteRecordRaw } from 'vue-router';
import { Layout, ParentLayout } from '@/router/constant';
import { DashboardOutlined } from '@vicons/antd';
import { renderIcon } from '@/utils/index';

const routeName = 'ReportForm';

/**
 * @param name 路由名称, 必须设置,且不能重名
 * @param redirect 重定向地址, 访问这个路由时,自定进行重定向
 * @param meta 路由元信息（路由附带扩展信息）
 * @param meta.disabled 禁用整个菜单
 * @param meta.title 菜单名称
 * @param meta.icon 菜单图标
 * @param meta.keepAlive 缓存该路由
 * @param meta.sort 排序越小越排前
 * */
const routes: Array<RouteRecordRaw> = [
  {
    path: '/report-form',
    name: routeName,
    redirect: '/report-form/employee',
    component: Layout,
    meta: {
      title: '报表中心',
      icon: renderIcon(DashboardOutlined),
      sort: 999,
    },
    children: [
      {
        path: 'employee',
        name: `${routeName}Employee`,
        redirect: '/report-form/employee/observer-statistics',
        component: ParentLayout,
        meta: {
          title: '员工分析',
        },
        children: [
          {
            path: 'observer-statistics',
            name: `${routeName}EmployeeObserverStatistics`,
            meta: {
              title: '监控员效率统计'
            },
            component: () => import('@/views/ReportForm/Employee/ObserverStatistics.vue'),
          },
        ]
      },
      {
        path: 'vehicle',
        name: `${routeName}Vehicle`,
        redirect: '/report-form/vehicle/status-statistics',
        component: ParentLayout,
        meta: {
          title: '车辆分析',
        },
        children: [
          {
            path: 'status-statistics',
            name: `${routeName}VehicleStatusStatistics`,
            meta: {
              title: '车辆状态统计'
            },
            component: () => import('@/views/ReportForm/Vehicle/StatusStatistics.vue'),
          },
          {
            path: 'mileage-statistics',
            name: `${routeName}VehicleMileageStatistics`,
            meta: {
              title: '行驶里程及时长统计'
            },
            component: () => import('@/views/ReportForm/Vehicle/MileageStatistics.vue'),
          },
          {
            path: 'run-statistics',
            name: `${routeName}VehicleRunStatistics`,
            meta: {
              title: '车辆行驶统计'
            },
            component: () => import('@/views/ReportForm/Vehicle/RunStatistics.vue'),
          },
          {
            path: 'stop-statistics',
            name: `${routeName}VehicleStopStatistics`,
            meta: {
              title: '车辆停车统计'
            },
            component: () => import('@/views/ReportForm/Vehicle/StopStatistics.vue'),
          },
        ]
      },
    ],
  },
];

export default routes;

/**
 * 员工分析
 *  监控员效率统计
 *
 * 车辆分析
 *  车辆状态统计
 *  行驶里程及时长统计
 *  车辆行驶统计
 *  车辆停车统计
 *
 * 设备报表
 *  ACC报表
 *
 * 运营与考核
 *  车型上线率统计
 *  车辆违规率统计
 *  分析日报
 *  分析月报
 *
 * 上级监督
 *  车辆漂移统计
 *  车辆离线位移统计
 *  车辆疲劳驾驶统计
 *  查岗信息统计
 *  ...
 *
 * 日志/记录分析
 *  ...
 */